//
//  HSRequest.h
//  Wutuojia
//
//  Created by anlun on 15/7/17.
//  Copyright (c) 2015年 anLun. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ALMacro.h"
#import "AFNetworking.h"
#import "ALBaseViewController.h"

static BOOL showLoadView=YES;

typedef enum {
    Get_type,
    Post_type
}ReqeustMethodEnum; //请求方式

@interface HSRequest : NSObject
@property (nonatomic , strong) ALBaseViewController *curCtrl;
//+ (AFHTTPRequestOperationManager *)sharedInstance;
+ (AFHTTPSessionManager *)sharedInstance;
/**
 *  通讯通用接口
 *
 *  @param apiName  MWApi.plist 里面的 key
 *  @param params       参数
 *  @param method       get或post或.....
 *  @param successBlock 成功返回block
 *  @param failedBlock  失败回调block
 *  @param reloginBlock 重新登录回调block
 */
+(void)requestApiName:(NSString *)apiName
            andParams:(NSDictionary *)params
            andMethod:(ReqeustMethodEnum)method
         successBlcok:(void(^)(id sucContent))successBlock
          failedBlock:(void(^)(id failContent))failedBlock
         reloginBlock:(void(^)(id reloginContent))reloginBlock;

+(void)requestApiName:(NSString *)apiName
			andParams:(NSDictionary *)params
			andMethod:(ReqeustMethodEnum)method
		 successBlcok:(void(^)(id sucContent))successBlock
		  failedBlock:(void(^)(id failContent))failedBlock
		 reloginBlock:(void(^)(id reloginContent))reloginBlock
		  andShowLoad:(BOOL)show andDelegate:(id)sender;   //是否显示通讯框

//这里是测试
+(void)requestApiName:(NSString *)apiName
			andIsTest:(BOOL)test
			andParams:(NSDictionary *)params
			andMethod:(ReqeustMethodEnum)method
		 successBlcok:(void(^)(id sucContent))successBlock
		  failedBlock:(void(^)(id failContent))failedBlock
		 reloginBlock:(void(^)(id reloginContent))reloginBlock;
@end
